I have a little question regarding this..
I will give an example: let's say i have this condition
Code:
int x = 5;
if(x ==2 || x ==5 || x ==1 || x ==8 || ....){
return 1;
}
Here I pretty much sure (correct me if I am wrong) that the code will stop at: x == 5 and will return 1, and will not continue to check all the rest of the numbers.
But when i use the operator | instead, like this:
Code:
unsigned short y = 316; // sorry for not using Hex number
unsigned short mask = 1;
if(((y <<1) & mask) | ((y << 2)& mask) | ((y >> 1) & mask) ...){
return 1;
}
let's assume that the first check will result in 1 (e.g. true) will the code stop and return 1 immediately like in the first example or it will continue to check until the end?
Thx!